3.175 \(\int \frac{(d+e x^2) (a+b \log (c x^n))}{x^3} \, dx\)

Optimal. Leaf size=52 \[ -\frac{d \left (a+b \log \left (c x^n\right )\right )}{2 x^2}+\frac{e \left (a+b \log \left (c x^n\right )\right )^2}{2 b n}-\frac{b d n}{4 x^2} \]

[Out]

-(b*d*n)/(4*x^2) - (d*(a + b*Log[c*x^n]))/(2*x^2) + (e*(a + b*Log[c*x^n])^2)/(2*b*n)

________________________________________________________________________________________

Rubi [A]  time = 0.0485854, antiderivative size = 47, normalized size of antiderivative = 0.9, number of steps used = 3, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {14, 2334, 2301} \[ -\frac{1}{2} \left (\frac{d}{x^2}-2 e \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )-\frac{b d n}{4 x^2}-\frac{1}{2} b e n \log ^2(x) \]

Antiderivative was successfully verified.

[In]

Int[((d + e*x^2)*(a + b*Log[c*x^n]))/x^3,x]

[Out]

-(b*d*n)/(4*x^2) - (b*e*n*Log[x]^2)/2 - ((d/x^2 - 2*e*Log[x])*(a + b*Log[c*x^n]))/2

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2334

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(x_)^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = I
ntHide[x^m*(d + e*x^r)^q, x]}, Simp[u*(a + b*Log[c*x^n]), x] - Dist[b*n, Int[SimplifyIntegrand[u/x, x], x], x]
] /; FreeQ[{a, b, c, d, e, n, r}, x] && IGtQ[q, 0] && IntegerQ[m] &&  !(EqQ[q, 1] && EqQ[m, -1])

Rule 2301

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rubi steps

\begin{align*} \int \frac{\left (d+e x^2\right ) \left (a+b \log \left (c x^n\right )\right )}{x^3} \, dx &=-\frac{1}{2} \left (\frac{d}{x^2}-2 e \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )-(b n) \int \left (-\frac{d}{2 x^3}+\frac{e \log (x)}{x}\right ) \, dx\\ &=-\frac{b d n}{4 x^2}-\frac{1}{2} \left (\frac{d}{x^2}-2 e \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )-(b e n) \int \frac{\log (x)}{x} \, dx\\ &=-\frac{b d n}{4 x^2}-\frac{1}{2} b e n \log ^2(x)-\frac{1}{2} \left (\frac{d}{x^2}-2 e \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )\\ \end{align*}

Mathematica [A]  time = 0.0023472, size = 57, normalized size = 1.1 \[ -\frac{a d}{2 x^2}+a e \log (x)-\frac{b d \log \left (c x^n\right )}{2 x^2}+\frac{b e \log ^2\left (c x^n\right )}{2 n}-\frac{b d n}{4 x^2} \]

Antiderivative was successfully verified.

[In]

Integrate[((d + e*x^2)*(a + b*Log[c*x^n]))/x^3,x]

[Out]

-(a*d)/(2*x^2) - (b*d*n)/(4*x^2) + a*e*Log[x] - (b*d*Log[c*x^n])/(2*x^2) + (b*e*Log[c*x^n]^2)/(2*n)

________________________________________________________________________________________

Maple [C]  time = 0.123, size = 266, normalized size = 5.1 \begin{align*} -{\frac{b \left ( -2\,e\ln \left ( x \right ){x}^{2}+d \right ) \ln \left ({x}^{n} \right ) }{2\,{x}^{2}}}-{\frac{-2\,i\ln \left ( x \right ) \pi \,be{\it csgn} \left ( i{x}^{n} \right ) \left ({\it csgn} \left ( ic{x}^{n} \right ) \right ) ^{2}{x}^{2}+2\,i\ln \left ( x \right ) \pi \,be{\it csgn} \left ( i{x}^{n} \right ){\it csgn} \left ( ic{x}^{n} \right ){\it csgn} \left ( ic \right ){x}^{2}+2\,i\ln \left ( x \right ) \pi \,be \left ({\it csgn} \left ( ic{x}^{n} \right ) \right ) ^{3}{x}^{2}-2\,i\ln \left ( x \right ) \pi \,be \left ({\it csgn} \left ( ic{x}^{n} \right ) \right ) ^{2}{\it csgn} \left ( ic \right ){x}^{2}+i\pi \,bd{\it csgn} \left ( i{x}^{n} \right ) \left ({\it csgn} \left ( ic{x}^{n} \right ) \right ) ^{2}-i\pi \,bd{\it csgn} \left ( i{x}^{n} \right ){\it csgn} \left ( ic{x}^{n} \right ){\it csgn} \left ( ic \right ) -i\pi \,bd \left ({\it csgn} \left ( ic{x}^{n} \right ) \right ) ^{3}+i\pi \,bd \left ({\it csgn} \left ( ic{x}^{n} \right ) \right ) ^{2}{\it csgn} \left ( ic \right ) +2\,enb \left ( \ln \left ( x \right ) \right ) ^{2}{x}^{2}-4\,\ln \left ( x \right ) \ln \left ( c \right ) be{x}^{2}-4\,\ln \left ( x \right ) ae{x}^{2}+2\,\ln \left ( c \right ) bd+bdn+2\,ad}{4\,{x}^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x^2+d)*(a+b*ln(c*x^n))/x^3,x)

[Out]

-1/2*b*(-2*e*ln(x)*x^2+d)/x^2*ln(x^n)-1/4*(-2*I*ln(x)*Pi*b*e*csgn(I*x^n)*csgn(I*c*x^n)^2*x^2+2*I*ln(x)*Pi*b*e*
csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)*x^2+2*I*ln(x)*Pi*b*e*csgn(I*c*x^n)^3*x^2-2*I*ln(x)*Pi*b*e*csgn(I*c*x^n)^2*
csgn(I*c)*x^2+I*Pi*b*d*csgn(I*x^n)*csgn(I*c*x^n)^2-I*Pi*b*d*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)-I*Pi*b*d*csgn(
I*c*x^n)^3+I*Pi*b*d*csgn(I*c*x^n)^2*csgn(I*c)+2*e*n*b*ln(x)^2*x^2-4*ln(x)*ln(c)*b*e*x^2-4*ln(x)*a*e*x^2+2*ln(c
)*b*d+b*d*n+2*a*d)/x^2

________________________________________________________________________________________

Maxima [A]  time = 1.17201, size = 66, normalized size = 1.27 \begin{align*} \frac{b e \log \left (c x^{n}\right )^{2}}{2 \, n} + a e \log \left (x\right ) - \frac{b d n}{4 \, x^{2}} - \frac{b d \log \left (c x^{n}\right )}{2 \, x^{2}} - \frac{a d}{2 \, x^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x^2+d)*(a+b*log(c*x^n))/x^3,x, algorithm="maxima")

[Out]

1/2*b*e*log(c*x^n)^2/n + a*e*log(x) - 1/4*b*d*n/x^2 - 1/2*b*d*log(c*x^n)/x^2 - 1/2*a*d/x^2

________________________________________________________________________________________

Fricas [A]  time = 1.33245, size = 153, normalized size = 2.94 \begin{align*} \frac{2 \, b e n x^{2} \log \left (x\right )^{2} - b d n - 2 \, b d \log \left (c\right ) - 2 \, a d + 2 \,{\left (2 \, b e x^{2} \log \left (c\right ) + 2 \, a e x^{2} - b d n\right )} \log \left (x\right )}{4 \, x^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x^2+d)*(a+b*log(c*x^n))/x^3,x, algorithm="fricas")

[Out]

1/4*(2*b*e*n*x^2*log(x)^2 - b*d*n - 2*b*d*log(c) - 2*a*d + 2*(2*b*e*x^2*log(c) + 2*a*e*x^2 - b*d*n)*log(x))/x^
2

________________________________________________________________________________________

Sympy [A]  time = 5.24912, size = 63, normalized size = 1.21 \begin{align*} - \frac{a d}{2 x^{2}} + a e \log{\left (x \right )} + b d \left (- \frac{n}{4 x^{2}} - \frac{\log{\left (c x^{n} \right )}}{2 x^{2}}\right ) - b e \left (\begin{cases} - \log{\left (c \right )} \log{\left (x \right )} & \text{for}\: n = 0 \\- \frac{\log{\left (c x^{n} \right )}^{2}}{2 n} & \text{otherwise} \end{cases}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x**2+d)*(a+b*ln(c*x**n))/x**3,x)

[Out]

-a*d/(2*x**2) + a*e*log(x) + b*d*(-n/(4*x**2) - log(c*x**n)/(2*x**2)) - b*e*Piecewise((-log(c)*log(x), Eq(n, 0
)), (-log(c*x**n)**2/(2*n), True))

________________________________________________________________________________________

Giac [A]  time = 1.326, size = 85, normalized size = 1.63 \begin{align*} \frac{2 \, b n x^{2} e \log \left (x\right )^{2} + 4 \, b x^{2} e \log \left (c\right ) \log \left (x\right ) + 4 \, a x^{2} e \log \left (x\right ) - 2 \, b d n \log \left (x\right ) - b d n - 2 \, b d \log \left (c\right ) - 2 \, a d}{4 \, x^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x^2+d)*(a+b*log(c*x^n))/x^3,x, algorithm="giac")

[Out]

1/4*(2*b*n*x^2*e*log(x)^2 + 4*b*x^2*e*log(c)*log(x) + 4*a*x^2*e*log(x) - 2*b*d*n*log(x) - b*d*n - 2*b*d*log(c)
 - 2*a*d)/x^2